package FactoryMethod

//工厂方法

type Person struct {
	name string
	age  int
}

// NewPersonFactory
// @author: lhg
// @Date: 2021-08-11 14:03:18
// @Description: 工厂方法
// @param age int
// @return func(name string) Person
//
func NewPersonFactory(age int) func(name string) Person {
	return func(name string) Person {
		return Person{
			name: name,
			age:  age,
		}
	}
}
